import {Controller, Get, HttpStatus, Req, Res} from '@nestjs/common';
import { AppService } from './app.service';

@Controller("book")
export class AppController {
  constructor(
      private readonly appService: AppService,
  ) {}

  @Get()
  getHello(): string {
    return this.appService.getHello();
  }

  @Get("/test")
  test(@Res() response) {

    setTimeout(()=>{
      this.appService.getMessageList().then(data=>console.log(data));
      this.appService.getBookList().then(data=>console.log(data));
      this.appService.getCategoryNameList().then(data=>console.log(data));
    },10000)

    response.status(HttpStatus.OK).json({a:1});
  }
}
